//
//  UIView+common.h
//  TojoyCloud
//
//  Created by 李亚川 on 2020/4/29.
//  Copyright © 2020 tianjiu. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/CAShapeLayer.h>
#import <QuartzCore/QuartzCore.h>
@interface UIView (common)


@property (assign, nonatomic) NSInteger var_typeTag;

/// 找到自己的vc
- (UIViewController *)wb_viewController;

/// 画虚线
- (void)wb_drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor;

/// 添加由浅到深的蓝色渐变色，添加之前需要设置self.frame
- (CAGradientLayer *)wb_doAddGrayGradientLayer;

/// 添加由浅到深的紫色渐变色，添加之前需要设置self.frame
- (CAGradientLayer *)wb_doAddPurpleGradientLayer;


/// 添加垂直渐变色，添加之前需要设置self.frame
/// @param startColor 开始颜色
/// @param endColor 结束颜色
- (CAGradientLayer *)wb_addVerticalGradientLayerStartColor:(CGColorRef)startColor endColor:(CGColorRef)endColor;

/// 添加水平渐变色，添加之前需要设置self.frame
/// @param startColor 开始颜色
/// @param endColor 结束颜色
- (CAGradientLayer *)wb_addHorizontalGradientLayerStartColor:(CGColorRef)startColor endColor:(CGColorRef)endColor;


/// 添加渐变色，添加之前需要设置self.frame
/// @param startColor 开始颜色
/// @param endColor 结束颜色
/// @param startPoint 开始点
/// @param endPoint 结束点
- (CAGradientLayer *)wb_doAddGradientLayerStartColor:(CGColorRef)startColor endColor:(CGColorRef)endColor startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint;


/// 顶部添加一个透明渐变的图层，直播间的聊天室
/// @param multiple 多样的
- (void)wb_doAddAlphaGradientLayer:(CGFloat)multiple;
- (void)wb_doAddAlphaGradientLayer:(CGFloat)multiple direction:(NSInteger)direction;

/// 移除渐变色layer
- (void)wb_doRemoveGraditentLayer;

/// 获取渐变色layer
- (CAGradientLayer *)wb_doGetGraditentLayer;

/// 边框阴影
/// @param aCornerRadius 半径
/// @param color 颜色
- (void)wb_setupShadowWithCornerRadius:(CGFloat)aCornerRadius color:(UIColor *)color;


/// 从UISearchBar里面获取输入框控件
/// @param aSearchBar 搜索框
+ (UITextField *)wb_doGetTextFiledFromSearchBar:(UISearchBar *)aSearchBar;

@end


@interface CALayer (TJTagLayer)
//tag
@property (nonatomic,assign)NSInteger var_Tag;
@end


